package com.hanxiang.hankol.help;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.baselibrary.bean.SelectSendFriend4Bean;
import com.baselibrary.bean.ShareItemBean;
import com.baselibrary.router.ActivityRouter;
import com.baselibrary.utils.UMShareUtils;
import com.hankol.community.SelectFriendShareActivity;
import com.hankol.community.ShareFriendActivity;
import com.hankol.feature_wine_meal.api.WineMealHelp;
import com.hot.BridgeConstant;
import com.umeng.socialize.bean.SHARE_MEDIA;

/**
 * @description:
 */
@Route(path = ActivityRouter.WINE_MEAL.WINE_MEAL_HELP)
public class WineMealHelpIm implements WineMealHelp {

    @Override
    public void init(Context context) {

    }

    /**
     * @param activity
     * @param userId                0 则是私信好友界面
     * @param shareItemBean
     * @param selectSendFriend4Bean
     */
    public void startShareFriend(@NonNull Activity activity, long userId, ShareItemBean shareItemBean, SelectSendFriend4Bean selectSendFriend4Bean) {
        Intent intent;
        if (userId == 0L) {
            intent = new Intent(activity, SelectFriendShareActivity.class);
        } else {
            intent = new Intent(activity, ShareFriendActivity.class);
        }

        if (shareItemBean != null) intent.putExtra("friend", shareItemBean);
        if (selectSendFriend4Bean != null) intent.putExtra("dynamic", selectSendFriend4Bean);
        activity.startActivity(intent);
    }

    @Override
    public void wxShare(@NonNull Activity activity, int scene, @NonNull String webpageUrl, @NonNull String title, @NonNull String desc, @NonNull String thumbnailUrl, int shareType) {
        UMShareUtils.shareWeb(activity, scene == 0 ? SHARE_MEDIA.WEIXIN : SHARE_MEDIA.WEIXIN_CIRCLE, webpageUrl,thumbnailUrl,title,desc);
    }

    @NonNull
    @Override
    public String getShareUrl() {
        return BridgeConstant.WINE_MEAL_SHARE_URL;
    }

    @NonNull
    @Override
    public String getIntroduceUrl() {
        return BridgeConstant.WINE_MEAL_INTRODUCE;
    }
}
